#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
	int N, K;
	scanf("%d %d", &N, &K);
	int *breeds = new int[N];
	bool *encountered = new bool[K];
	memset(breeds, 0, sizeof(int) * N);
	memset(encountered, false, sizeof(bool) * K);
	for (int i = 0; i < N; i++) {
		scanf("%d", breeds + i);
	}

	int nonSubsequenceLength = 1;
	int encounter = 0;
	for (int i = 0; i < N; i++) {
		if (!encountered[breeds[i] - 1]) {
			encountered[breeds[i] - 1] = true;
			++encounter;

			if (encounter == K) {
				encounter = 0;
				++nonSubsequenceLength;
				memset(encountered, false, sizeof(bool) * K);
			}
		}
	}

	printf("%d\n", nonSubsequenceLength);

	delete[] breeds;
	delete[] encountered;
	return 0;
}